package com.opensky.sys.interfaces.facade.example;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.opensky.sys.application.service.MybatisPlusExampleService;
import com.opensky.sys.application.service.TkMybatisExampleService;
import com.opensky.sys.domain.mybatis.entity.MybatisPlusExampleEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 建类说明：mybatis例子扩展
 * 当前版本：1.0.0
 *
 * @author 中国印
 * @date 2021年12月30日
 * @since 1.0.0
 */
@Api(tags = "Mybatis示例扩展Facade")
@RestController
@RequestMapping("/mybatis-extend")
public class MybatisExampleExtendFacade {

    @Resource
    private MybatisPlusExampleService mybatisPlusExampleService;

    @Resource
    private TkMybatisExampleService tkMybatisExampleService;

    @ApiOperationSupport(order = 10, author = "🇨🇳中国印🇨🇳")
    @ApiOperation("①mybatis-plus自定义sql")
    @GetMapping("/customSql1")
    public List<MybatisPlusExampleEntity> findListByMybatisPlus() {
        return mybatisPlusExampleService.findListByMybatisPlus();
    }

    @ApiOperationSupport(order = 20, author = "🇨🇳中国印🇨🇳")
    @ApiOperation("②tk-mybatis自定义sql")
    @GetMapping("/customSql2")
    public List<MybatisPlusExampleEntity> findListByTkMybatis() {
        return tkMybatisExampleService.findListByTkMybatis();
    }





}
